<?php
defined('IN_MAIN') or exit('Invalid Access!');

function generate_dmy_input($name, $day, $month, $year, $extra="", $start_from_year=""){
//day
$r_day[0]="";
$r_day_d[""]=__("Day");
for($i=1;$i<=31;$i++){
 $r_day[$i]=$i;
 $r_day_d[$i]=$i;
}
$day_select=build_select($r_day, $r_day_d, $day, $name."_day", $extra);
//month
$r_month[0]="";
$r_month_d[""]=__("Month");
for($i=1;$i<=12;$i++){
 $r_month[$i]=$i;
 $r_month_d[$i]=$i;
}
$month_select=build_select($r_month, $r_month_d, $month, $name."_month", $extra);
//year
$r_year[0]="";
$r_year_d[""]=__("Year");
$sf_year=$start_from_year && is_numeric($start_from_year)? $start_from_year : 1900;
for($i=ndate("Y");$i>=$sf_year;$i--){
 $r_year[]=$i;
 $r_year_d[$i]=$i;
}
$year_select=build_select($r_year, $r_year_d, $year, $name."_year", $extra);

$dmy_input="<table><tr><td>".__("Day").__(":")." $day_select "."</td><td>".__("Month").__(":")." $month_select "."</td><td>".__("Year").__(":")." $year_select"."</td></tr></table>";
return $dmy_input;
}
?>